package com.xsj.mapper;

import com.xsj.pojo.Card;
import com.xsj.vo.CardVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * @BelongsProject: wisdom-restaurant-manage
 * @BelongsPackage: com.xsj.mapper
 * @Author: tutu
 * @CreateTime: 2025-06-22 21:24
 * @Description: TODO
 * @Version: 1.0
 */
@Mapper
public interface CardMapper {

    List<Card> getCard(@Param("userId") Integer userId);


    int addCard(CardVO card);


    //判断是否已经领取
    CardVO haveCard(@Param("userId") int userId,@Param("cardId") int cardId);

    //搜索卡券
    List<HashMap<String,Object>> searchCard(String keyWord);

    Card getCardDetailsById(@Param("cardId") Integer cardId);

    List<HashMap<String,Object>> getCardList(@Param("userId") Integer userId);

    int countUserClaimsForCard(@Param("userId") Integer userId, @Param("cardId") Integer cardId);


    List<Card> allCard();
}
